﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="CricGroundDetails.aspx.vb" Inherits="CricketForum.CricGroundDetails" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <h1>
            Cricket Ground Details :
        </h1>
    </p>
    <div>
        <asp:DataList ID="DataList1" runat="server" DataSourceID="PlayerDetails" Width="100%">
            <ItemTemplate>
                <table width="100%">
                    <tr>
                        <td>
                            <h4>
                                Stadium Name:</h4>
                        </td>
                        <td>
                        <b>
                            <%# Eval("StadiumName")%></b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                Address:</h4>
                        </td>
                        <td>
                            <%# Eval("Address")%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                City:</h4>
                        </td>
                        <td>
                            <%# Eval("City")%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                PostCode:</h4>
                        </td>
                        <td>
                            <%# Eval("PostCode")%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                Country:</h4>
                        </td>
                        <td>
                            <%# Eval("Country")%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                PhoneNumber:</h4>
                        </td>
                        <td>
                            <%# Eval("PhoneNumber")%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                URL</h4>
                        </td>
                        <td>
                            <asp:HyperLink ID="HyperLink1" runat="server" Target="_blank" NavigateUrl='<%# Eval("URL") %>'>
                                    <%# Eval("URL")%></asp:HyperLink>
                        </td>
                    </tr>
                     <tr>
                        <td>
                            <h4>
                                Posted By:</h4>
                        </td>
                        <td>
                            <%# Eval("CreatedBy")%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                Posted Date:</h4>
                        </td>
                        <td>
                            <%# Eval("CreatedDate", "{0:g}")%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                Staduium Picture:</h4>
                        </td>
                        <td>
                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Picture") %>' Width="450px"
                                Height="350px" ImageAlign="Middle" />
                        </td>
                    </tr>
                   
                </table>
            </ItemTemplate>
            <FooterStyle />
        </asp:DataList>
    </div>
     <p>
        <h1>
            Comments and Stadium Pictures:
        </h1>
    </p>
    <p>
        <asp:GridView ID="gvComments" runat="server" AllowSorting="True" AutoGenerateColumns="False"  DataKeyNames="ID"
            Width="100%" >
            <EmptyDataTemplate>
                No Comments and Stadium Pictures Found. Please upload Stadium Picture.
            </EmptyDataTemplate>
            <HeaderStyle CssClass="H1" />
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="Comment ID" Visible="false"   />
                <asp:BoundField DataField="Title" HeaderText="Comment Title" SortExpression="Title" />
                <asp:BoundField DataField="UserComments" HeaderText="User Comments" SortExpression="UserComments" />
                <asp:TemplateField HeaderText="Team Picture">
                    <ItemTemplate>
                        <asp:Image ID="GroundPicture" runat="server" ImageUrl='<%# Eval("GroundPicture") %>'
                            Width="300px" Height="300px" ImageAlign="Middle" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Commented By" SortExpression="CreatedBy">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# "~/Account/UserProfile.aspx?ID=" + Eval("CreatedBy") %>'>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("CreatedBy") %>'></asp:Label>
                        </asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="CreatedDate" HeaderText="Commented Date" HtmlEncode="false"
                    DataFormatString="{0:g}" SortExpression="CreatedDate" />
                <asp:TemplateField ShowHeader="True" HeaderText="Like and Unlike">
                    <ItemTemplate>
                        <asp:ImageButton ID="Image3" ImageUrl="~/Pictures/General/like.png" runat="server"
                            Width="60px" Height="30px" CausesValidation="False" CommandName="Delete" Text="Like or Unlike" />
                        <%--<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"   
                            CommandName="Delete"  Text="Like or Unlike"></asp:LinkButton>
                              <asp:Image ID="Image2" ImageUrl="~/Pictures/General/like.png" runat="server"  Width="60px" Height="30px" CausesValidation="False"  />--%>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:BoundField DataField="Likes" HeaderText="Number Of Likes" />
            </Columns>
        </asp:GridView>
    </p>
    <div>
        <table width="100%">
            <tr>
                <td>
                    <asp:Button ID="btnAddComment" runat="server" Text="Add Stadium Picture and Comments" />
                </td>
            </tr>
        </table>
    </div>
    <asp:SqlDataSource ID="PlayerDetails" runat="server" ConnectionString="<%$ ConnectionStrings:ConnStringWorldsCricket %>"
        ProviderName="<%$ ConnectionStrings:ConnStringWorldsCricket.ProviderName %>"
        SelectCommand="SELECT * FROM CricketGrounds WHERE (ID = ?) ">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>